﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SuperMarketSystem
{
    public partial class StartInterface : UserControl
    {
        event CustomerStartEventHandler customerStart;
        event RestockerStartEventHandler restockerStart;
        event ManagerStartEventHandler managerStart;
        event TimerEventHandler timerEvent;
        public StartInterface(SelfCheckStation parent)
        {
            InitializeComponent();
            customerStart += parent.customerhandler;
            restockerStart += parent.restockerhandler;
            managerStart += parent.managerhandler;
            timerEvent += parent.timerhandler;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (customerStart != null)
                customerStart(this);
        }

        private void restockerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (restockerStart != null)
                restockerStart(this);
        }

        private void managerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (managerStart != null)
                managerStart(this);
        }

        private void timerToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Generate Mdinight Timer Event?", "Timer", MessageBoxButtons.YesNo) == DialogResult.Yes)
            {
                if (timerEvent != null)
                    timerEvent();
            }

        }
    }
}
